﻿using System.Collections;
using System.IO.Ports;
using System.Xml;
using TYBase;

namespace TYRTUBase
{
    public abstract class TYRTUBase : ITYClient
    {
        public override string ParaKey()
        {
            return $"{Port}";
        }

        public int Port { get; private set; }
        public int BaudRate { get; private set; }
        public Parity Parity { get; private set; }
        public int DataBits { get; private set; }
        public StopBits StopBits { get; private set; }
        public byte[] NewLine { get; private set; } = new byte[] { 0x0D, 0x0A };

        public TYRTUBase(int _port, ComPara para)
        {
            Port = _port;
            BaudRate = para.baudRate;
            Parity = para.parity;
            DataBits = para.dataBits;
            StopBits = para.stopBits;
            NewLine = para.NewLine;
        }

    }
}